<?php
class Ext_Queue_Client
{
    private $className = null;
    public function __construct ($broker, $queue)
    {
        $this->queue = new Ext_Queue($broker, $queue);
    }
    public function setClass ($className)
    {
        $this->className = $className;
    }
    public function __call ($name, $arguments)
    {
        if ($this->className == null || in_array($name, get_class_methods($this->className))) {
            // Call this function over activeMQ queue.
            $message = new Ext_Queue_ExecMessage();
            $message->setFunction($name);
            $message->setArguments($arguments);
            $this->queue->enqueue($message->getMessage());
            return true;
        }
        return new Ext_Error('Invalid Method');
    }
}
